package easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.metadata.CellExtra;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.read.listener.ReadListener;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.Map;

@Slf4j
public class LawDataListener implements ReadListener<HashMap<String,String>> {

    @Override public void onException(final Exception exception, final AnalysisContext context) throws Exception {

    }

    @Override public void invokeHead(final Map<Integer, ReadCellData<?>> headMap, final AnalysisContext context) {

    }

    @Override public void invoke(final HashMap<String, String> data, final AnalysisContext context) {
        log.info(String.valueOf(data));
    }

    @Override public void extra(final CellExtra extra, final AnalysisContext context) {

    }

    @Override public void doAfterAllAnalysed(final AnalysisContext context) {

    }

    @Override public boolean hasNext(final AnalysisContext context) {
//        return context.readRowHolder().getRowIndex()<9 ? true : false;
        return true;
    }

}
